/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.schedule.manage.util;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleJobChangeAllOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleJobCreateOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleJobDeleteOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleJobEditOrder;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleJobManageAddForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleJobManageChangeAllForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleJobManageDeleteForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleJobManageEditForm;

/**
 * <b>(ScheduleJobManageConvertor)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/7
 */
public class ScheduleJobManageConvertor {

    public static ScheduleJobCreateOrder convertOrder(ScheduleJobManageAddForm form) {
        return BeanUtil.toBean(form, ScheduleJobCreateOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static ScheduleJobEditOrder convertOrder(ScheduleJobManageEditForm form) {
        return BeanUtil.toBean(form, ScheduleJobEditOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static ScheduleJobDeleteOrder convertOrder(ScheduleJobManageDeleteForm form) {
        return BeanUtil.toBean(form, ScheduleJobDeleteOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static ScheduleJobChangeAllOrder convertOrder(ScheduleJobManageChangeAllForm form) {
        return BeanUtil.toBean(form, ScheduleJobChangeAllOrder.class, CopyOptions.create().setIgnoreNullValue(true));
    }
}